<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <input v-model="num1" type="text">
        <span>*</span>
        <input v-model="num2" type="text">
        <span>=</span>
        <span>{{ result }}</span>

        <div :xx="result">

        </div>
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                num1: 0,
                num2: 0
            },

            // 计算属性的本质是一个函数，但是用的时候
            // 就把他当普通属性来用
            // 普通属性可以怎么用，计算属性就能怎么用
            computed: {
                result () {

                    return this.num1 * this.num2
                }
            }
        })
    </script>
</body>
</html>